﻿@model Rezene.Web.Models.ListPageViewModel
@{
    ViewBag.Title = Model.CurrentGallery != null ? Model.CurrentGallery.DisplayName : "Home";
}

@if (Model.IsHome)
{
    Html.RenderPartial("_ListHome", Model);
    return;
}
<div class="span4 sidebar page-sidebar">
    <h2 class="title-bg">GALLERIES</h2>
    <ul class="popular-posts">
        @if (Model.Galleries.Any())
        {
            foreach (var gallery in Model.Galleries)
            {
                <li>
                    <a href="@Url.Action("List", "Gallery", new {id = gallery.AmazonPath})"><h6>@gallery.DisplayName ( @gallery.Name )</h6></a>
                    @if (Model.IsAuthorized)
                    {
                        <a href="@Url.Action("EditGallery", "Editor", new {path = gallery.AmazonPath})"><span class="icon-pencil"></span>Edit</a>
                    }
                </li>
            }
        }
    </ul>
</div>
<div class="span8 clearfix">
    <h2 class="title-bg">PHOTOS</h2>
    @if (Model.Photos.Any())
    {
        <div class="gallery">
            <div class="row clearfix">
                <ul class="gallery-post-grid holder">
                    @foreach (var photo in Model.Photos)
                    {
                        <li class="span2 gallery-item">
                            <span class="gallery-hover-6col hidden-phone hidden-tablet">
                                <span class="gallery-icons">
                                    <a href="//@photo.AmazonPublicPath" class="item-zoom-link lightbox" title="@photo.Description" data-rel="prettyPhoto[gallery]">
                                        <img class="hidden" alt="@photo.Title" />
                                    </a>
                                </span>
                            </span>
                            <a href="@Url.Action("Single", "Gallery", new {path = photo.AmazonPath})">
                                <div class="img-container">
                                    <img src="//@photo.AmazonPublicPath" alt="@photo.Title" />
                                </div>
                            </a>
                            <span class="project-details">
                                <a href="@Url.Action("Single", "Gallery", new {path = photo.AmazonPath})">@photo.Title</a>
                                @photo.Description
                            </span>
                            @if (Model.IsAuthorized)
                            {
                                <a href="@Url.Action("EditPhoto", "Editor", new {path = photo.AmazonPath})"><span class="icon-pencil"></span>Edit</a>
                            }


                        </li>
                    }
                </ul>
            </div>
        </div>
    }

</div>
